package com.zzs.client.config;

import com.zzs.common.core.constant.RabbitConsts;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author zzs
 * @date 2025/04/01
 */
@Configuration
public class RabbitConfig {
    @Bean
    public DirectExchange javaDirectExchange() {
        return new DirectExchange(RabbitConsts.JAVA_EXCHANGE, true, false);
    }

    @Bean
    public Queue javaQueue() {
        return new Queue(RabbitConsts.JAVA_QUEUE, true);
    }

    @Bean
    public MessageConverter messageConverter() {
        return new Jackson2JsonMessageConverter();
    }
}
